import request from "@/utils/request";

const path = '/talk'

// 获取所有的说说
export const getTalkList = (status) => {
  return request({
    url: path + `/list/ ${status}`
  })
}

// 隐藏说说
export const concealTalk = (id, status) => {
  return request({
    url: path + `/conceal/${id}/${status}`,
    method: 'put'
  })
}

// 删除评论
export const delComment = (id, talkId) => {
  return request({
    url: path + `/delcomment/${id}/${talkId}`,
    method: 'delete'
  })
}

// 发布说说
export const sendTalk = (data) => {
  return request({
    url: path + '/send',
    method: 'post',
    data
  })
}

// 修改说说
export const updateTalkApi = (id, data) => {
  return request({
    url: path + `/update/${id}`,
    method: 'put',
    data
  })
}

// 删除说说
export const delTalkApi = (id) => {
  return request({
    url: path + `/deltalk/${id}`,
    method: 'delete'
  })
}

// 分页查询用户
export const pageUserList = (pageParams) => {
  return request({
    url: path + `/users/${pageParams.page}/${pageParams.limit}`,
    params: {
      name: pageParams.name
    }
  })
}

// 删除用户
export const delUserApi = (id) => {
  return request({
    url: path + `/deluser/${id}`,
    method: 'delete'
  })
}